<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="judge">
			<h1 v-if="1==1">{{test_1}}</h1>
			<h1 v-if="test_1 == 'aaa' ">{{test_1}}</h1>
			<h1 v-for='item in test_2'>
				{{item.name}}				
			</h1>
			<template v-for='(item,index) in test_2'>			 
			  <h1 v-if='item.name != "" ' @click='item.name = "aaaaa"'>
			  	 {{item.name}}
			  </h1>
			  <button v-show='item.flg == 0' @click='Change(item,index)' type="button" class="btn btn-danger"><i class="icon-trash">停用</i></button>
				<button v-show='item.flg == 1' @click='Change(item,index)' type="button" class="btn btn-success"><i class="icon-ok-sign">启用</i></button>
			</template>
			
			
			
			
			
			
		</div>
		<script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
		<script src="vue.min.js"></script>
		<script type="text/javascript">
			new Vue({
				el:'#judge',
				data:{
					test_1:'aaa',
					test_2:[{name:'hehehe',flg:0},{name:'xixixi',flg:1}]					
				},
				methods:{
					Change:function(item,index){
//						test_2[index].flg  = !test_2[index].flg 
//						test_2.splice(index,1)
						item.flg = !item.flg
						console.log(item)
					}
				}
			})
			
			
			
		</script>
	</body>
</html>
